const http = require('http');

const options = {
  hostname: 'localhost',
  port: 9001,
  path: '/api/v1/procurement/purchase-orders?page=1&limit=10',
  method: 'GET',
  headers: {
    'Authorization': 'Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyIjp7ImlkIjoxLCJuYW1lIjoiYWRtaW4ifSwiaWF0IjoxNzYzMTkyMzQ4LCJleHAiOjE3NjMyNzg3NDh9.Nd4EohKdo81C5Cu_aRbz6Kbk28dG83oHVE8tWp8SFjI'
  }
};

const req = http.request(options, res => {
  console.log('Status:', res.statusCode);
  res.on('data', d => {
    process.stdout.write(d);
  });
});

req.on('error', error => {
  console.error('Error:', error);
});

req.end();